/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * GuiFuncionalidades.java
 *
 * Created on 21/11/2011, 18:16:09
 */

package GUI;
import java.awt.Dialog;
import javax.swing.JDialog;
import javax.swing.JOptionPane;
import tp1POO.GestorLog;
import tp1POO.Modelo.Funcionario;
/**
 *
 * @author matheus
 */
public class GuiFuncionalidades extends javax.swing.JFrame {
	private Funcionario funcionario;
	/** Creates new form GuiFuncionalidades */
	public GuiFuncionalidades() {
		initComponents();
	}

	public GuiFuncionalidades(Funcionario func) {
		this();
		this.funcionario = func;
		jLUsuario.setText(this.funcionario.getCargo().toString());

		if (this.funcionario.getCargo() == Funcionario.Cargo.Vendedor) {
			jTabbedAdd.remove(jPFunc);
		}
		else if (this.funcionario.getCargo() == Funcionario.Cargo.Auxiliar){
			jTabbedAdd.remove(jPFunc);
			jTabbedAdd.remove(jPRem);
			jTabbedAdd.remove(jPPesq);
		}
	}

	/** This method is called from within the constructor to
	 * initialize the form.
	 * WARNING: Do NOT modify this code. The content of this method is
	 * always regenerated by the Form Editor.
	 */
	@SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLUsuario = new javax.swing.JLabel();
        jTabbedAdd = new javax.swing.JTabbedPane();
        jPAdd = new javax.swing.JPanel();
        jBAddCliente = new javax.swing.JButton();
        jBAddVeiculo = new javax.swing.JButton();
        jBAddTipo = new javax.swing.JButton();
        jBAddLoc = new javax.swing.JButton();
        jBAddMot = new javax.swing.JButton();
        jLabel2 = new javax.swing.JLabel();
        jPRem = new javax.swing.JPanel();
        jBRemLoc = new javax.swing.JButton();
        jBARemCliente = new javax.swing.JButton();
        jBRemTipo = new javax.swing.JButton();
        jBRemVeiculo = new javax.swing.JButton();
        jBRemMot = new javax.swing.JButton();
        jLabel3 = new javax.swing.JLabel();
        jPPesq = new javax.swing.JPanel();
        jBPesqCliente = new javax.swing.JButton();
        jBPesqVeiculoDisp = new javax.swing.JButton();
        jBPesqAlug = new javax.swing.JButton();
        jBPesqLocAb = new javax.swing.JButton();
        jBPesqLocFec = new javax.swing.JButton();
        jBVeicRent = new javax.swing.JButton();
        jLabel4 = new javax.swing.JLabel();
        jBPesqCatV = new javax.swing.JButton();
        jPFunc = new javax.swing.JPanel();
        jBAddFunc = new javax.swing.JButton();
        jBRemFunc = new javax.swing.JButton();
        jBLogOut = new javax.swing.JButton();
        jBSair = new javax.swing.JButton();
        jBList = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Funcionalidades");
        setBackground(new java.awt.Color(255, 248, 248));

        jBAddCliente.setText("Cliente");
        jBAddCliente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBAddClienteActionPerformed(evt);
            }
        });

        jBAddVeiculo.setText("Veículo");
        jBAddVeiculo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBAddVeiculoActionPerformed(evt);
            }
        });

        jBAddTipo.setText("Tipo de Veículo");
        jBAddTipo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBAddTipoActionPerformed(evt);
            }
        });

        jBAddLoc.setText("Locação");
        jBAddLoc.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBAddLocActionPerformed(evt);
            }
        });

        jBAddMot.setText("Motorista");
        jBAddMot.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBAddMotActionPerformed(evt);
            }
        });

        jLabel2.setText("Selecione um item para ser cadastrado:");

        javax.swing.GroupLayout jPAddLayout = new javax.swing.GroupLayout(jPAdd);
        jPAdd.setLayout(jPAddLayout);
        jPAddLayout.setHorizontalGroup(
            jPAddLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPAddLayout.createSequentialGroup()
                .addGroup(jPAddLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPAddLayout.createSequentialGroup()
                        .addGap(38, 38, 38)
                        .addGroup(jPAddLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jBAddVeiculo)
                            .addComponent(jBAddCliente))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 180, Short.MAX_VALUE)
                        .addGroup(jPAddLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jBAddTipo)
                            .addComponent(jBAddLoc))
                        .addGap(103, 103, 103)
                        .addComponent(jBAddMot))
                    .addGroup(jPAddLayout.createSequentialGroup()
                        .addGap(167, 167, 167)
                        .addComponent(jLabel2)))
                .addContainerGap())
        );

        jPAddLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jBAddCliente, jBAddLoc, jBAddMot, jBAddTipo, jBAddVeiculo});

        jPAddLayout.setVerticalGroup(
            jPAddLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPAddLayout.createSequentialGroup()
                .addContainerGap(30, Short.MAX_VALUE)
                .addComponent(jLabel2)
                .addGap(18, 18, 18)
                .addGroup(jPAddLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPAddLayout.createSequentialGroup()
                        .addComponent(jBAddCliente)
                        .addGap(18, 18, 18)
                        .addComponent(jBAddVeiculo))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPAddLayout.createSequentialGroup()
                        .addGroup(jPAddLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jBAddLoc)
                            .addComponent(jBAddMot))
                        .addGap(18, 18, 18)
                        .addComponent(jBAddTipo)))
                .addContainerGap())
        );

        jTabbedAdd.addTab("Adicionar", jPAdd);

        jBRemLoc.setText("Locação");
        jBRemLoc.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBRemLocActionPerformed(evt);
            }
        });

        jBARemCliente.setText("Cliente");
        jBARemCliente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBARemClienteActionPerformed(evt);
            }
        });

        jBRemTipo.setText("Tipo de Veículo");
        jBRemTipo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBRemTipoActionPerformed(evt);
            }
        });

        jBRemVeiculo.setText("Veículo");
        jBRemVeiculo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBRemVeiculoActionPerformed(evt);
            }
        });

        jBRemMot.setText("Motorista");
        jBRemMot.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBRemMotActionPerformed(evt);
            }
        });

        jLabel3.setText("Selecione um item para ser removido:");

        javax.swing.GroupLayout jPRemLayout = new javax.swing.GroupLayout(jPRem);
        jPRem.setLayout(jPRemLayout);
        jPRemLayout.setHorizontalGroup(
            jPRemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPRemLayout.createSequentialGroup()
                .addGroup(jPRemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPRemLayout.createSequentialGroup()
                        .addGap(40, 40, 40)
                        .addGroup(jPRemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jBRemVeiculo)
                            .addComponent(jBARemCliente))
                        .addGap(94, 94, 94)
                        .addGroup(jPRemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jBRemTipo)
                            .addGroup(jPRemLayout.createSequentialGroup()
                                .addComponent(jBRemLoc)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 187, Short.MAX_VALUE)
                                .addComponent(jBRemMot))))
                    .addGroup(jPRemLayout.createSequentialGroup()
                        .addGap(166, 166, 166)
                        .addComponent(jLabel3)))
                .addContainerGap())
        );

        jPRemLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jBARemCliente, jBRemLoc, jBRemMot, jBRemTipo, jBRemVeiculo});

        jPRemLayout.setVerticalGroup(
            jPRemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPRemLayout.createSequentialGroup()
                .addContainerGap(30, Short.MAX_VALUE)
                .addComponent(jLabel3)
                .addGap(18, 18, 18)
                .addGroup(jPRemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPRemLayout.createSequentialGroup()
                        .addComponent(jBARemCliente)
                        .addGap(18, 18, 18)
                        .addComponent(jBRemVeiculo))
                    .addGroup(jPRemLayout.createSequentialGroup()
                        .addGroup(jPRemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jBRemLoc)
                            .addComponent(jBRemMot))
                        .addGap(18, 18, 18)
                        .addComponent(jBRemTipo)))
                .addContainerGap())
        );

        jTabbedAdd.addTab("Remover", jPRem);

        jBPesqCliente.setText("Cliente");
        jBPesqCliente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBPesqClienteActionPerformed(evt);
            }
        });

        jBPesqVeiculoDisp.setText("Veículos Disponíveis");
        jBPesqVeiculoDisp.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBPesqVeiculoDispActionPerformed(evt);
            }
        });

        jBPesqAlug.setText("Veículos mais Alugados");
        jBPesqAlug.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBPesqAlugActionPerformed(evt);
            }
        });

        jBPesqLocAb.setText("Locações em Aberto");
        jBPesqLocAb.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBPesqLocAbActionPerformed(evt);
            }
        });

        jBPesqLocFec.setText("Locações Fechadas");
        jBPesqLocFec.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBPesqLocFecActionPerformed(evt);
            }
        });

        jBVeicRent.setText("Veículos mais Rentáveis");
        jBVeicRent.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBVeicRentActionPerformed(evt);
            }
        });

        jLabel4.setText("Selecione um item para ser pesquisado:");

        jBPesqCatV.setText("Categoria de Veículo");
        jBPesqCatV.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBPesqCatVActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPPesqLayout = new javax.swing.GroupLayout(jPPesq);
        jPPesq.setLayout(jPPesqLayout);
        jPPesqLayout.setHorizontalGroup(
            jPPesqLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPPesqLayout.createSequentialGroup()
                .addGap(26, 26, 26)
                .addGroup(jPPesqLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPPesqLayout.createSequentialGroup()
                        .addGroup(jPPesqLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jBPesqVeiculoDisp)
                            .addComponent(jBPesqCliente))
                        .addGap(18, 18, 18)
                        .addGroup(jPPesqLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jBPesqAlug)
                            .addComponent(jBPesqLocAb)))
                    .addComponent(jLabel4))
                .addGap(18, 18, 18)
                .addGroup(jPPesqLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jBPesqCatV)
                    .addComponent(jBPesqLocFec)
                    .addComponent(jBVeicRent))
                .addContainerGap(103, Short.MAX_VALUE))
        );

        jPPesqLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jBPesqAlug, jBPesqCatV, jBPesqCliente, jBPesqLocAb, jBPesqLocFec, jBPesqVeiculoDisp, jBVeicRent});

        jPPesqLayout.setVerticalGroup(
            jPPesqLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPPesqLayout.createSequentialGroup()
                .addContainerGap(18, Short.MAX_VALUE)
                .addGroup(jPPesqLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel4)
                    .addComponent(jBPesqCatV))
                .addGap(18, 18, 18)
                .addGroup(jPPesqLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPPesqLayout.createSequentialGroup()
                        .addComponent(jBPesqLocFec)
                        .addGap(18, 18, 18)
                        .addComponent(jBVeicRent))
                    .addGroup(jPPesqLayout.createSequentialGroup()
                        .addComponent(jBPesqLocAb)
                        .addGap(18, 18, 18)
                        .addComponent(jBPesqAlug))
                    .addGroup(jPPesqLayout.createSequentialGroup()
                        .addComponent(jBPesqCliente)
                        .addGap(18, 18, 18)
                        .addComponent(jBPesqVeiculoDisp)))
                .addContainerGap())
        );

        jTabbedAdd.addTab("Pesquisar", jPPesq);

        jBAddFunc.setIcon(new javax.swing.ImageIcon("/home/matheus/Documentos/POO/workspace/TP2_POO/Imagens/plus.gif")); // NOI18N
        jBAddFunc.setText("Add");
        jBAddFunc.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBAddFuncActionPerformed(evt);
            }
        });

        jBRemFunc.setIcon(new javax.swing.ImageIcon("/home/matheus/Documentos/POO/workspace/TP2_POO/Imagens/red_minus.gif")); // NOI18N
        jBRemFunc.setText("Remover");
        jBRemFunc.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBRemFuncActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPFuncLayout = new javax.swing.GroupLayout(jPFunc);
        jPFunc.setLayout(jPFuncLayout);
        jPFuncLayout.setHorizontalGroup(
            jPFuncLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPFuncLayout.createSequentialGroup()
                .addGap(119, 119, 119)
                .addComponent(jBAddFunc)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 247, Short.MAX_VALUE)
                .addComponent(jBRemFunc)
                .addGap(134, 134, 134))
        );

        jPFuncLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jBAddFunc, jBRemFunc});

        jPFuncLayout.setVerticalGroup(
            jPFuncLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPFuncLayout.createSequentialGroup()
                .addContainerGap(66, Short.MAX_VALUE)
                .addGroup(jPFuncLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jBAddFunc)
                    .addComponent(jBRemFunc))
                .addGap(60, 60, 60))
        );

        jPFuncLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jBAddFunc, jBRemFunc});

        jTabbedAdd.addTab("Funcionários", jPFunc);

        jBLogOut.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagens/system-log-out3.png"))); // NOI18N
        jBLogOut.setText("LogOut");
        jBLogOut.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBLogOutActionPerformed(evt);
            }
        });

        jBSair.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagens/icoErro.gif"))); // NOI18N
        jBSair.setText("Sair");
        jBSair.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBSairActionPerformed(evt);
            }
        });

        jBList.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagens/seta.gif"))); // NOI18N
        jBList.setText("Listar");
        jBList.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBListActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(20, 20, 20)
                .addComponent(jLUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, 202, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(490, 490, 490))
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedAdd, javax.swing.GroupLayout.DEFAULT_SIZE, 692, Short.MAX_VALUE)
                .addGap(8, 8, 8))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addGap(87, 87, 87)
                .addComponent(jBList)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 243, Short.MAX_VALUE)
                .addComponent(jBLogOut)
                .addGap(67, 67, 67)
                .addComponent(jBSair)
                .addContainerGap())
        );

        layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jBList, jBLogOut, jBSair});

        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jTabbedAdd, javax.swing.GroupLayout.PREFERRED_SIZE, 194, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jBSair)
                    .addComponent(jBLogOut)
                    .addComponent(jBList))
                .addContainerGap())
        );

        layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jBList, jBLogOut, jBSair});

        jTabbedAdd.getAccessibleContext().setAccessibleName("Add");

        pack();
    }// </editor-fold>//GEN-END:initComponents







	public Funcionario getFuncionario () {
		return this.funcionario;
	}







	private void jBAddTipoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBAddTipoActionPerformed
		GestorLog.obterInstancia().inserirMsgLog("Funcionalidade de Adicionar tipos de veículo foi iniciada ("+this.funcionario.getCpf()+")");
		GuiCreator.obterInstancia().criarGuiTipo();
	}//GEN-LAST:event_jBAddTipoActionPerformed

	private void jBRemTipoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBRemTipoActionPerformed
		GestorLog.obterInstancia().inserirMsgLog("Funcionalidade de Remover Tipos de veículo foi iniciada ("+this.funcionario.getCpf()+")");
		GuiCreator.obterInstancia().criarGuiRemTipo();
	}//GEN-LAST:event_jBRemTipoActionPerformed

	private void jBAddClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBAddClienteActionPerformed
		GestorLog.obterInstancia().inserirMsgLog("Funcionalidade de Adicionar cliente foi iniciada ("+this.funcionario.getCpf()+")");
		GuiCreator.obterInstancia().criarGuiCliente();
	}//GEN-LAST:event_jBAddClienteActionPerformed

	private void jBSairActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBSairActionPerformed
		GestorLog.obterInstancia().inserirMsgLog(this.funcionario.getCpf()+" SAIU DO SISTEMA.\n\n\n\n");
		System.exit(0);
	}//GEN-LAST:event_jBSairActionPerformed

	private void jBPesqAlugActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBPesqAlugActionPerformed
		GestorLog.obterInstancia().inserirMsgLog("Funcionalidade de Pesquisar por veículos mais alugados foi iniciada ("+this.funcionario.getCpf()+")");
		GuiCreator.obterInstancia().criarGuiResultPesq(1);
	}//GEN-LAST:event_jBPesqAlugActionPerformed

	private void jBPesqClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBPesqClienteActionPerformed
		GestorLog.obterInstancia().inserirMsgLog("Funcionalidade de Pesquisar por cliente foi iniciada ("+this.funcionario.getCpf()+")");
		GuiCreator.obterInstancia().criarGuiPesqCliente();
	}//GEN-LAST:event_jBPesqClienteActionPerformed

	private void jBAddVeiculoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBAddVeiculoActionPerformed
		GestorLog.obterInstancia().inserirMsgLog("Funcionalidade de Adicionar veículo foi iniciada ("+this.funcionario.getCpf()+")");
		GuiCreator.obterInstancia().criarGuiVeiculo();
	}//GEN-LAST:event_jBAddVeiculoActionPerformed

	private void jBPesqVeiculoDispActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBPesqVeiculoDispActionPerformed
		GestorLog.obterInstancia().inserirMsgLog("Funcionalidade de Pesquisar por veículos disponíveis foi iniciada ("+this.funcionario.getCpf()+")");
		GuiCreator.obterInstancia().criarGuiResultPesq(0);
	}//GEN-LAST:event_jBPesqVeiculoDispActionPerformed

	private void jBVeicRentActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBVeicRentActionPerformed
		GestorLog.obterInstancia().inserirMsgLog("Funcionalidade de Pesquisar por veículos mais rentáveis foi iniciada ("+this.funcionario.getCpf()+")");
		GuiCreator.obterInstancia().criarGuiResultPesq(2);
	}//GEN-LAST:event_jBVeicRentActionPerformed

	private void jBPesqCatVActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBPesqCatVActionPerformed
		GestorLog.obterInstancia().inserirMsgLog("Funcionalidade de Pesquisar por veículos de uma determinada categoria foi iniciada ("+this.funcionario.getCpf()+")");
		GuiCreator.obterInstancia().criarGuiResultPesq(-1);
	}//GEN-LAST:event_jBPesqCatVActionPerformed

	private void jBPesqLocAbActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBPesqLocAbActionPerformed
		GestorLog.obterInstancia().inserirMsgLog("Funcionalidade de Pesquisar por Locações em aberto foi iniciada ("+this.funcionario.getCpf()+")");
		GuiCreator.obterInstancia().criarGuiResultPesq(3);
	}//GEN-LAST:event_jBPesqLocAbActionPerformed

	private void jBAddMotActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBAddMotActionPerformed
		GestorLog.obterInstancia().inserirMsgLog("Funcionalidade de Adicionar motorista foi iniciada ("+this.funcionario.getCpf()+")");
		GuiCreator.obterInstancia().criarGuiMotorista(0);
	}//GEN-LAST:event_jBAddMotActionPerformed

	private void jBPesqLocFecActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBPesqLocFecActionPerformed
		GestorLog.obterInstancia().inserirMsgLog("Funcionalidade de Pesquisar por locações fechadas foi iniciada ("+this.funcionario.getCpf()+")");
		GuiCreator.obterInstancia().criarGuiResultPesq(4);
	}//GEN-LAST:event_jBPesqLocFecActionPerformed

	private void jBAddLocActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBAddLocActionPerformed
		GestorLog.obterInstancia().inserirMsgLog("Funcionalidade de Adicionar locações foi iniciada ("+this.funcionario.getCpf()+")");
		GuiCreator.obterInstancia().criarGuiLocacao();
	}//GEN-LAST:event_jBAddLocActionPerformed

	private void jBListActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBListActionPerformed
		GestorLog.obterInstancia().inserirMsgLog("Funcionalidade de Listar foi iniciada ("+this.funcionario.getCpf()+")");
		GuiCreator.obterInstancia().criarGuiList();
	}//GEN-LAST:event_jBListActionPerformed

	private void jBLogOutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBLogOutActionPerformed
		if (!GuiCreator.obterInstancia().existeOutroFrameAberto()) {
			GestorLog.obterInstancia().inserirMsgLog(this.funcionario.getCpf()+" fez logout.");
			GuiCreator.obterInstancia().criarGuiPrincipal();
			GuiCreator.obterInstancia().removerGuiFuncionalidades();
		}
	}//GEN-LAST:event_jBLogOutActionPerformed

	private void jBARemClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBARemClienteActionPerformed
		GestorLog.obterInstancia().inserirMsgLog("Funcionalidade de Remover clientes foi iniciada ("+this.funcionario.getCpf()+")");
		GuiCreator.obterInstancia().criarGuiRemCliente();
	}//GEN-LAST:event_jBARemClienteActionPerformed

	private void jBRemVeiculoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBRemVeiculoActionPerformed
		GestorLog.obterInstancia().inserirMsgLog("Funcionalidade de Remover veículos foi iniciada ("+this.funcionario.getCpf()+")");
		GuiCreator.obterInstancia().criarGuiRemVeiculo();
	}//GEN-LAST:event_jBRemVeiculoActionPerformed

	private void jBRemMotActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBRemMotActionPerformed
		GestorLog.obterInstancia().inserirMsgLog("Funcionalidade de Remover motorista foi iniciada ("+this.funcionario.getCpf()+")");
		GuiCreator.obterInstancia().criarGuiRemMotorista();
	}//GEN-LAST:event_jBRemMotActionPerformed

	private void jBRemFuncActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBRemFuncActionPerformed
		GestorLog.obterInstancia().inserirMsgLog("Funcionalidade de Remover funcionários foi iniciada ("+this.funcionario.getCpf()+")");
		GuiCreator.obterInstancia().criarGuiRemFuncionario();
	}//GEN-LAST:event_jBRemFuncActionPerformed

	private void jBRemLocActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBRemLocActionPerformed
		GestorLog.obterInstancia().inserirMsgLog("Funcionalidade de Remover locações foi iniciada ("+this.funcionario.getCpf()+")");
		GuiCreator.obterInstancia().criarGuiRemLoc();
	}//GEN-LAST:event_jBRemLocActionPerformed

	private void jBAddFuncActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBAddFuncActionPerformed
		GestorLog.obterInstancia().inserirMsgLog("Funcionalidade de Adicionar funcionários foi iniciada ("+this.funcionario.getCpf()+")");
		GuiCreator.obterInstancia().criarGuiFuncionario();
	}//GEN-LAST:event_jBAddFuncActionPerformed




















	/**
	 * @param args the command line arguments
	 */
	public static void main(String args[]) {
		java.awt.EventQueue.invokeLater(new Runnable() {
			public void run() {
				new GuiFuncionalidades().setVisible(true);
			}
		});
	}

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jBARemCliente;
    private javax.swing.JButton jBAddCliente;
    private javax.swing.JButton jBAddFunc;
    private javax.swing.JButton jBAddLoc;
    private javax.swing.JButton jBAddMot;
    private javax.swing.JButton jBAddTipo;
    private javax.swing.JButton jBAddVeiculo;
    private javax.swing.JButton jBList;
    private javax.swing.JButton jBLogOut;
    private javax.swing.JButton jBPesqAlug;
    private javax.swing.JButton jBPesqCatV;
    private javax.swing.JButton jBPesqCliente;
    private javax.swing.JButton jBPesqLocAb;
    private javax.swing.JButton jBPesqLocFec;
    private javax.swing.JButton jBPesqVeiculoDisp;
    private javax.swing.JButton jBRemFunc;
    private javax.swing.JButton jBRemLoc;
    private javax.swing.JButton jBRemMot;
    private javax.swing.JButton jBRemTipo;
    private javax.swing.JButton jBRemVeiculo;
    private javax.swing.JButton jBSair;
    private javax.swing.JButton jBVeicRent;
    private javax.swing.JLabel jLUsuario;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JPanel jPAdd;
    private javax.swing.JPanel jPFunc;
    private javax.swing.JPanel jPPesq;
    private javax.swing.JPanel jPRem;
    private javax.swing.JTabbedPane jTabbedAdd;
    // End of variables declaration//GEN-END:variables

}
